package com.bangdream.michelia.view.fragment.main.curriculum;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.andview.refreshview.XRefreshView;
import com.bangdream.michelia.R;
import com.bangdream.michelia.presenter.base.BasePresenter;
import com.bangdream.michelia.view.adapter.CurriculumChapterAdapter;
import com.bangdream.michelia.view.adapter.CurriculumDataAdapter;
import com.bangdream.michelia.view.adapter.CurriculumListAdapter;
import com.bangdream.michelia.view.fragment.currency.BaseFragment;
import com.bangdream.michelia.view.fragment.currency.LazyLoadFragment;

/**
 * @date on 2018/7/23 17:51
 * @email 909732184@qq.com
 * 课程详情-资料
 */
public class CurriculumDetailsData extends LazyLoadFragment {
    private View view;
    private XRefreshView refreshView;
    private RecyclerView recyclerView;
    private LinearLayoutManager linearLayoutManager;
    private CurriculumListAdapter adapter;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.curriculum_data,container,false);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        init();
    }

    @Override
    public BasePresenter createPresenter() {
        return null;
    }

    @Override
    public void loadData() {

    }

    private void init() {
        refreshView = view.findViewById(R.id.refreshView);
        refreshView.setPullLoadEnable(false);
        refreshView.setPullRefreshEnable(false);
        linearLayoutManager = new LinearLayoutManager(getActivity());
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView = view.findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(linearLayoutManager);
        adapter = new CurriculumListAdapter(R.layout.curriculum_data_adapter_item);
        recyclerView.setAdapter(adapter);
        initEmptyView(recyclerView);
        adapter.setEmptyView(noDataView);

    }
}
